package mob.dev.blpr;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.widget.ListView;
import android.widget.RemoteViews;

public class HelloWidget extends AppWidgetProvider {
	
	private List<String> tasks;
	
	@Override
	public void onEnabled(Context context){
		
		tasks = new ArrayList<String>();
		SharedPreferences prefs = context.getSharedPreferences("tasks_list", Context.MODE_PRIVATE);
		@SuppressWarnings("unchecked")
		Map<String, String> taskMap = (Map<String, String>) prefs.getAll();
		
		for (Integer i = 0; i< taskMap.size(); i++){
			tasks.add(taskMap.get(i.toString()));	
		}
		
		//I <exploitvie deleted> cannot figure out how to update the listview in the app.
		//TODO figure out how to pass the list to the view.
	}

	
}
